/**
* This file is part of mobileworks.
*
* mobileworks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
* along with dev.clipall.  If not, see <http://www.gnu.org/licenses/>.
*
* https://code.google.com/p/mobileworks/
*/

package base;

import model.gml.State;

/**
 *
 * @author Erol Hira
 */
public class Engine {
    
    private State state;
    
    //------------------------------------------------------------------
    
    private static Engine engine = new Engine();
    
    private Engine(){}
    
    public static Engine getInstance(){
        return engine;
    }
    
    //------------------------------------------------------------------
    
    public void loadState(int stateId){
        
        int pageIndex = ResourceAccess.getPageId(stateId);
        
        loadPage(pageIndex);
    }   

    private void loadPage(int pageIndex) {
        
        short[][] components = ResourceAccess.pages[pageIndex][0];
        short[][] menus = ResourceAccess.pages[pageIndex][1];
        
        loadComponents(components);
        
    }
    
    private void loadComponents(short[][] components) {
        
        int componentSize = components.length;
        
        for(int i = 0; i < componentSize; i++){                        
            
            int styleId = components[i][0];
            
            for(int j = 1; j < components[i].length; j++){
                
                int propId = components[i][j];
                
                
            }
        }
    }
}
